﻿@model List<iChip.Hotspots.Models.FieldValue>
@{
    Layout = null;
}
<div class="modal-content">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h4 class="modal-title">Thêm giá trị cho mục: @Model[0].Field_Name</h4>
    </div>
    <div class="modal-body">
        <div class="row">
            <div class="col-md-12">
                @if(Model!=null && Model.Count>0)
                {
                    foreach(var item in Model)
                    {
                        <p>@Html.TextBoxFor(m => item.FieldValue_Value, new { @class="form-control", Name = "FieldValue_Value"})</p>        
                        @Html.TextBoxFor(m => item.Field_Id, new { @class = "form-control hidden", Name="Field_Id" })
                        @Html.TextBoxFor(m => item.FieldValue_Id, new { @class = "form-control hidden", Name = "FieldValue_Id" })
                    }
                }
                else
                {
                    <p>@Html.TextBox("FieldValue_Value", new { @class = "form-control", Name = "FieldValue_Value" })</p> 
                    @Html.TextBox("Field_Id", new { @class = "form-control hidden", Name = "Field_Id", Vaule = @Model[0].Field_Id })
                    @Html.TextBox("FieldValue_Id", new { @class = "form-control hidden", Name = "Field_Id", Vaule = @Model[0].FieldValue_Id })
                }               
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" data-dismiss="modal" class="btn">Đóng</button>
        <button type="button" class="btn blue" onclick="AddFiledValueOther(@Model[0].Field_Id);">Thêm trường</button>
        <button type="button" class="btn green" onclick="SaveFieldValue()">Cập nhật</button>
    </div>
</div>
